3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next
A renderer is of type TQ3RendererObject , which is a type of shared object. You create an instance of a renderer by calling Q3Renderer_New or Q3Renderer_NewFromType . Once you've created a new renderer, you need to associate it with a particular view, for example by calling Q3View_SetRenderer .
You've already seen (in the section "Creating a View" ) how to create a renderer object and attach it to a view object. As indicated previously, you can ensure that you take advantage of any available hardware accelerator by using the interactive renderer, as follows:
myRenderer = Q3Renderer_NewFromType(kQ3RendererTypeInteractive);
To make the rendered images coherent, you should make the associated draw context double buffered (that is, you should set the doubleBufferState field of the draw context data structure to the value kQ3True ). Some hardware rasterizer engines (such as the one supplied by Apple Computer, Inc.) can make coherent images without double buffering. This can provide a significant speed advantage, at the possible cost of some tearing. To take advantage of such hardware, you keep the draw context double buffered (to indicate that you want the images to be coherent) and call the function Q3InteractiveRenderer_SetDoubleBufferBypass, as follows:
Q3InteractiveRenderer_SetDoubleBufferBypass(myRenderer, kQ3True);
In the unlikely event that you want to use a particular rasterizer with the interactive renderer, you can set a preference with the code:
Q3InteractiveRenderer_SetPreferences(myRenderer, vendor, engine);
Values that define the available vendors and engines are described in "Vendor IDs" and "Engine IDs" .
Previous | QD3D Book | Overview | Chapter Contents | Next